package cn.kgc.springcloud2038.order80.service;

import cn.kgc.springcloud2038.api.pojo.CommonResult;
import cn.kgc.springcloud2038.api.pojo.Payment;
import cn.kgc.springcloud2038.order80.service.impl.PaymentOpenFeign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Component
@FeignClient(value = "cloud-payment-service",fallback = PaymentOpenFeign.class)
public interface PaymentFeignService {
    @GetMapping(value = "/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);
    @PostMapping(value = "/payment/create")
    public CommonResult create(@RequestBody Payment payment);
}
